package com.story.api.config;

import com.story.api.config.properties.SubMailProperties;
import com.submail.lib.MESSAGEXsend;
import com.submail.utils.AppConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Administrator
 * @decription 配置appConfig
 * @Date 2018-02-02 10:05
 */
@Configuration
public class SubMailConfig {

    @Autowired
    private SubMailProperties subMailProperties;

    @Bean
    public MESSAGEXsend getAppConfig() {
        AppConfig appConfig = new AppConfig();
        appConfig.setAppId(subMailProperties.getAppId());
        appConfig.setAppKey(subMailProperties.getAppKey());
        MESSAGEXsend messageXsend = new MESSAGEXsend(appConfig);
        return messageXsend;
    }
}
